<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<form method="post" th:action="@{/users/add}">
<table>
    <tr>
        <td>账户</td>
        <td><input name="account" th:value="${user.account}"></td>
    </tr>
    <tr>
        <td>昵称</td>
        <td><input name="realName" th:value="${user.realName}"></td>
    </tr>
    <tr>
        <td>性别</td>
        <td>
            <input name="sex" th:checked="${user.sex == 0}" type="radio" value="0">男
            <input name="sex" th:checked="${user.sex != 0}" type="radio" value="1">女
        </td>
    </tr>
    <tr>
        <td>角色</td>
        <td>
            <select name="roleId">
                <option value="">请选择</option>
                <option th:selected="${user.roleId == 1}" value="1">管理员</option>
                <option th:selected="${user.roleId == 2}" value="2">经理</option>
                <option th:selected="${user.roleId == 3}" value="3">用户</option>
            </select>
        </td>
    </tr>
    <tr>
        <td>生日</td>
        <td><input name="birthday" type="date" th:value="${#dates.format(user.birthday,'yyyy-MM-dd')}"></td>
    </tr>
    <tr>
        <td colspan="2">
            <input type="submit" value="添加">
            <input type="button" value="返回" onclick="location.href='/users'">
        </td>
    </tr>
</table>
</form>
</body>
</html>